import {createApp} from 'vue'
import App from './App.vue'
import router from '@/router'
//引入element plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import myconfirm from './utils/myconfirm'
//国际化
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import {createPinia} from 'pinia'
import piniaPersist from 'pinia-plugin-persist'

const pinia = createPinia()
//使用持久化插件
pinia.use(piniaPersist)
const app = createApp(App);

app.use(router).use(ElementPlus
    ,{
        locale:zhCn,
    }
    ).use(router).use(pinia).mount('#app')
//全局注册图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
//全局挂载
app.config.globalProperties.$myconfirm = myconfirm;